package config

import "fmt"

type Listener func()

type NacosConfigRequest struct {
    Tenant  string //  Tenant information. It corresponds to the Namespace field in Nacos.
    DataId  string // 	Configuration ID
    Group   string // 	Configuration group
    Tag string //
    Content string //Configuration content
}

func (r *NacosConfigRequest) RequestGetEndpoint() string {
    str := fmt.Sprintf("%s?dataId=%s&group=%s&tenant=%s", ENDPOINT_CONFIGS, r.DataId, r.Group, r.Tenant)
    return str
}
func (r *NacosConfigRequest) RequestPublishEndpoint() string {
    str := fmt.Sprintf("%s", ENDPOINT_CONFIGS)
    return str
}
func (r *NacosConfigRequest) RequestPostFormData() string {
    str := fmt.Sprintf("dataId=%s&group=%s&tenant=%s&content=%s", r.DataId, r.Group, r.Tenant, r.Content)
    return str
}
